home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8978 < prev    next >
Encoding:
Text File  |  1996-08-05  |  749 b   |  29 lines

  1. Path: news.wyoming.com!usenet
  2. From: dcromley@wyoming.com (Dave Cromley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: sizeof class
  5. Date: 27 Feb 1996 18:21:48 GMT
  6. Organization: wyoming.com LLC
  7. Message-ID: <4gvi3s$53a@horn.wyoming.com>
  8. References: <Pine.SOL.3.91.960226185535.3663A-100000@turing.uncg.edu>
  9. NNTP-Posting-Host: cys-cap-6.wyoming.com
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.2
  12.  
  13. Bin . Lee wrote:
  14. >class TestClass {};
  15. >sizeof TestClass is 1 for BC++, is this normal ? 
  16. >Where dose computer store this pointer ? 
  17.  
  18. Yes, it is 1, isn't it? 
  19. I would have thought the size would be 0.
  20. There is no pointer.
  21.  
  22. class TestClass2 { int i1; };
  23. has a sizeof 2--the size of the int.
  24. struct TestStruct { };
  25. has a sizeof 1--I would have expected 0.
  26.  
  27.   Dave C.
  28.  
  29.